import {ajaxFun} from "../../utils/ajax"
Page({

  data:{
    username:"18292417675",
    password:"crmeb@123456"
  },
  async loginFun(){
    let {token}=await ajaxFun("/login","post",{
       account:this.data.username,
       password:this.data.password
    })
    if(token){
      wx.setStorageSync('token', token)
      wx.switchTab({
        url: '/pages/index/index',
      })
    }else{
      wx.showToast({
        title: '账号密码错误',
        icon:"error"
      })
    }
  }
})